package com.twu.biblioteca.command;

import com.twu.biblioteca.BibliotecaSystem;
import com.twu.biblioteca.util.Messages;

/**
 * Created with IntelliJ IDEA.
 * User: twer
 * Date: 5/21/13
 * Time: 4:11 PM
 * To change this template use File | Settings | File Templates.
 */
public class CheckMembershipCommand extends Command {

    private BibliotecaSystem system;

    public CheckMembershipCommand(BibliotecaSystem system) {
        this.system = system;
    }

    @Override
    public void runCommand() {
        checkMembershipDetails();
    }

    private void checkMembershipDetails() {
        if(system.isLoggedIn()) {
            System.out.println(system.getLoggedUser().toString());
        } else {
            System.out.println(Messages.Check_Membership_Details);
        }
    }
}
